/*
 * File:   main.cpp
 * Author: hao
 *
 * Created on 2011年5月4日, 上午1:01
 */

#include <QtGui/QApplication>
#include <iostream>
#include "mainForm.h"

int main(int argc, char *argv[]) {
    // initialize resources, if needed
    // Q_INIT_RESOURCE(resfile);
    
    string dir;
    string tmp( argv[0] );
    int pos;
    for( pos = tmp.size() - 1; pos >= 0; pos-- ){
        if( tmp[pos] == '/' ) break;
    }
    
    
    
    dir = tmp.substr( 0, pos + 1 );
    
    chdir( dir.c_str() );
    
    int res = 0;
    
    try{

    QApplication app(argc, argv);

    // create and show your widgets here
    
    mainForm mainform;
    
    mainform.show();

    res = app.exec();
    }
    catch( const Error & ex ){
        cerr<<ex.what()<<endl;
    }
    
    return res;
}
